import * as types from './mutation-types'

export default {
	[types.SET_FRIENDS](state,payload){
		state.friends = payload;
	},
	[types.SET_GROUPS](state,payload){
		state.groups = payload;
	},
	[types.SET_APPR_COUNT](state,payload){
		state.apprCount = payload;
	},
	[types.SET_GROUP_JOIN_COUNT](state,payload){
		state.groupJoinCount = payload;
	},
	mixGroup(state,payload){
		if(!payload||!payload.id){
			return
		}
		const target = state.groups.find(({id})=>id==payload.id)
		if(!target){
			return 
		}
		return Object.assign(target,payload)
	}
}
